import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/tabbar/Home'
import Message from '@/components/tabbar/Message'
import Call from '@/components/tabbar/Call'
import Setup from '@/components/tabbar/Setup'
import newsList from '@/components/news/newsList'
import newsInfo from '@/components/news/newsinfo'
import Pics from '@/components/picshare/pics'
import moment from 'moment'
import picinfo from '@/components/picshare/picinfo'
import goodsList from '@/components/goods/goodsList'
import goodsinfo from '@/components/goods/goodsinfo'
import goodspicinfos from '@/components/goods/goodspicinfos'
import goodscomment from '@/components/goods/goodscomment'


Vue.use(Router)
Vue.filter('comment',function(datastr,style='YYYY-MM-DD HH:mm:ss'){
  return moment(datastr).format(style)
})
export default new Router({

  routes: [{
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'Home',
      component: Home
    }, {
      path: '/call',
      component: Call
    }, {
      path: '/message',
      component: Message
    }, {
      path: '/setup',
      component: Setup
    }, {
      path: '/home/newsList',
      component: newsList
    }, {
      path: '/home/newsInfo/:id',
      component: newsInfo
    }, {
      path: '/home/pics',
      component: Pics
    }, {
      path: '/home/pics/picinfo/:id',
      component: picinfo
    }, {
      path: '/home/goods',
      component: goodsList
    }, {
      path: '/home/goods/goodsinfo/:id',
      component: goodsinfo,
      name:'goodsinfo'
    }, {
      path: '/home/goods/goodspicinfos/:id',
      component: goodspicinfos,
      name:'goodspicinfos'
    }, {
      path: '/home/goods/goodscomment/:id',
      component: goodscomment,
      name:'goodscomment'
    }
  ],
  linkActiveClass: 'mui-active'
})
